<!--
 * @Author: lmk
 * @Date: 2021-11-29 17:54:26
 * @LastEditTime: 2021-12-04 02:44:20
 * @LastEditors: lmk
 * @Description: 
-->
<template>
	<view>
		<view  class="u-flex u-row-between u-margin-top-20 text-order-time u-font-20" @click.stop="goIphone(item.contactNumber)">
		  <text>联系电话：{{item.contactNumber ? item.contactNumber : ''}}</text>
		  <u-icon name="dianhua" size="25" custom-prefix="custom-icon" color="#765CFE"></u-icon>
		</view>
		<view class="u-flex u-row-between u-margin-top-20 text-order-time u-font-20" @click.stop="mapAddress(item)">
		  <view class="u-flex-1 u-line-1" style="width: 0;">门店地址：{{item.address || ''}}</view>
		  <u-icon name="daohang" size="30" custom-prefix="custom-icon" color="#765CFE"></u-icon>
		</view>
		<template v-if="showStatus">
			<view class="u-flex u-row-between u-margin-top-20 text-order-time u-font-20" @click.stop="mapAddress(item)">
				<view class="u-flex-1 u-line-1" style="width: 0;">营业状态：{{item.businessState || ''}}</view>
			</view>
			<view class="u-flex u-row-between u-margin-top-20 text-order-time u-font-20" @click.stop="mapAddress(item)">
				<view class="u-flex-1 u-line-1" style="width: 0;">营业时间：{{item.dayTimeStart.substr(10,6)}} - {{item.dayTimeEnd.substr(10,6)}}</view>
			</view>
		</template>

	</view>
</template>

<script>
	export default {
		name:"contact",
		props:{
			item:{
				type:Object,
				default:()=>({})
			},
			showStatus:{
				type:Boolean,
				default:true
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			//拨打电话
			goIphone(iphone){
				if(!iphone) return false
				uni.makePhoneCall({
					phoneNumber: iphone
				})
			},
			// 门店导航
			mapAddress(item) {
				uni.openLocation({
					latitude: Number(item.latitude),//要去的纬度-地址
					longitude: Number(item.longitude),//要去的经度-地址
					name: item.name,//地址名称
					address: item.address,//详细地址名称
					success: function () {
						console.log('导航成功');
					},
					fail: function (error) {
						console.log(error)
					}
				});
			},
		},
	}
</script>

<style lang="scss">

</style>
